Skip to content

[FSSDK-11142] Add cmab client and tests #402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Mat001
Copy link
Contributor

@Mat001 Mat001 commented Apr 23, 2025

Add CMAB client and unit tests.

https://jira.sso.episerver.net/browse/FSSDK-11142

@Mat001 Mat001 self-assigned this Apr 23, 2025
@Mat001 Mat001 changed the title [DRAFT][FSSDK-11142]add cmab client and tests [DRAFT][FSSDK-11142] Add cmab client and tests Apr 23, 2025
@Mat001 Mat001 changed the title [DRAFT][FSSDK-11142] Add cmab client and tests [FSSDK-11142] Add cmab client and tests Apr 29, 2025
@Mat001 Mat001 marked this pull request as ready for review April 29, 2025 22:23
@Mat001 Mat001 requested review from Copilot and raju-opti April 29, 2025 22:23
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a new CMAB client with an integrated exponential backoff retry mechanism and unit tests for decision fetching from the CMAB API.

  • Introduces the DefaultCmabClient with retry configuration and error handling
  • Implements request marshalling, API response validation, and logging for retries

Comment on lines +166 to +167
// Create context for cancellation
ctx := context.Background()
Copy link
Preview

Copilot AI Apr 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider accepting a context parameter in FetchDecision (or using the context passed from a higher layer) instead of always using context.Background(). This change would allow for better cancellation and deadline management in production use.

Suggested change
// Create context for cancellation
ctx := context.Background()
// Use the provided context for cancellation

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant